#!/usr/bin/python
# encoding: utf-8
class Osteoporosis():
    """
    骨质疏松症评估
    https://wenku.baidu.com/view/e78bf4edf8b069dc5022aaea998fcc22bcd143ad.html
    https://mp.weixin.qq.com/s/fio_MX2UuHmJ5vB1EVZRNw
    """

    def __init__(self):
        """
        评估模型包含吸烟、喝酒、服用药物、家族疾病史、疾病史、生活习惯、bmi、治疗史、症状9种因素
        """
        pass

    def calc(self, data):
        index = (int(data['weight']) - int(data['age'])) * 0.2
        if index <= -4:
            return {"result": "  您急需骨质疏松检测，推荐您做骨折筛查和骨密度测定"}
        elif -1 <= index < -4:
            return {"result": "  您的骨质疏松风险程度一般，要多注意预防"}
        else:
            return {"result": "  恭喜，您的骨质疏松风险程度低，记得日常注意防护喲"}
